package com.eliza.base.entity.model.user

import android.content.Context
import androidx.work.CoroutineWorker
import androidx.work.WorkerParameters

class RefreshMainDataWork(
    context: Context,
    params: WorkerParameters,
    private val repository: UserDao
) :
    CoroutineWorker(context, params) {
    override suspend fun doWork(): Result {
        return try {
            repository.getAll()
            Result.success()
        } catch (error: Error) {
            Result.failure()
        }
    }
}